This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 25, 2014, 4:13 PM
2 Posts

typeahead function prevent editbox styling

  • Category: Styles and Themes
  • Platform: All
  • Release: 8.5.3
  • Role: Administrator,Developer,End User
  • Tags: xpages typeahead
  • Replies: 1
I have two edit boxes.
Second one with typeahead enabled.
I want on onFocus event make editbox background e.g. yellow...
I do it this way:
 
var fldObj = dojo.byId("myEditBox");
     if (!fldObj) {
           fldObj = dojo.query("[id$=':myEditBox']");
     if (fldObj) {
           fldObj = fldObj[0];
     }
}
if (fldObj != null) {
     fldObj.style.background="yellow";
}
 
it works perfect for the first edit box but not for the one with typeahead enabled..
Any suggestion?
 
Thanks
Mar 26, 2014, 1:26 PM
366 Posts
XPages rendering engine assignes id's

you have to use the csjs / ssjs conversion to get the id of the element you want in your csjs.

either

"#{javascript:getClientId("CustomerName1")}"

or

"#{id:CustomerName1}"

so in your case dojo.byId("#{id:myEditBox}");

should work if the name of the component is 'myEditBox'


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal